using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;

namespace SimpleFramework
{
    public class TemplateLoader<T> : Loader
    {
        protected UnityWebRequest m_Request;
        protected UnityEvent<ILoader, T> m_Complete = new UnityEvent<ILoader, T>();

        public UnityEvent<ILoader, T> onComplete { get { return m_Complete; } }

        public override float Progress { get { return m_Request.downloadProgress; } }

        public override bool IsDone { get { return m_Request.isDone; } }

        public override ulong downloadedBytes { get { return m_Request.downloadedBytes; } }

        public override void Reset()
        {
            base.Reset();
            this.onComplete.RemoveAllListeners();
        }
    }
}